#pragma once

#include <vector>
#include <string>

#define MAX_XCAP_URI_LENGTH 512

class BuddyEntry;
class GroupEntry;
class ServiceEntry;

typedef std::vector<std::string> string_vector;
typedef std::vector<BuddyEntry> buddy_vector;
typedef std::vector<GroupEntry> group_vector;
typedef std::vector<ServiceEntry> service_vector;
typedef enum
{
	E_XML_ACCESS_PATH_NOT_FOUND_ERR,
	E_XML_ACCESS_ENTRY_NOT_FOUND_ERR,
	E_XML_ACCESS_ALREADY_EXISTS_ERR,
	E_XML_ACCESS_OK
}XMLTreeAccessResult;

typedef enum
{
	male,
	female,
	notset
}ESexType;

class ContactInfo
{
public:
	ContactInfo(){}
	std::string EmailAddress() const { return emailAddress; }
	void EmailAddress(std::string val) { emailAddress = val; }
	std::string DefaultUCNumber() const { return defaultUCNumber; }
	void DefaultUCNumber(std::string val) { defaultUCNumber = val; }
	std::string DefaultPocNumber() const { return defaultPocNumber; }
	void DefaultPocNumber(std::string val) { defaultPocNumber = val; }
	std::string DefaultMessageNumber() const { return defaultMessageNumber; }
	void DefaultMessageNumber(std::string val) { defaultMessageNumber = val; }
	std::string DefaultFaxNumber() const { return defaultFaxNumber; }
	void DefaultFaxNumber(std::string val) { defaultFaxNumber = val; }
	std::string HomeTel() const { return homeTel; }
	void HomeTel(std::string val) { homeTel = val; }
	std::string OfficeTel() const { return officeTel; }
	void OfficeTel(std::string val) { officeTel = val; }
	std::string MobileTel() const { return mobileTel; }
	void MobileTel(std::string val) { mobileTel = val; }
	std::string AutoTel() const { return autoTel; }
	void AutoTel(std::string val) { autoTel = val; }
	std::string SecondHomeTel() const { return secondHomeTel; }
	void SecondHomeTel(std::string val) { secondHomeTel = val; }
	std::string SecondOfficeTel() const { return secondOfficeTel; }
	void SecondOfficeTel(std::string val) { secondOfficeTel = val; }
	std::string SecondMobileTel() const { return secondMobileTel; }
	void SecondMobileTel(std::string val) { secondMobileTel = val; }
	std::string HomeAddress() const { return homeAddress; }
	void HomeAddress(std::string val) { homeAddress = val; }
	std::string OfficeAddress() const { return officeAddress; }
	void OfficeAddress(std::string val) { officeAddress = val; }
	std::string OtherAddress() const { return otherAddress; }
	void OtherAddress(std::string val) { otherAddress = val; }
protected:
	std::string emailAddress;
	std::string defaultUCNumber;
	std::string defaultPocNumber;
	std::string defaultMessageNumber;
	std::string defaultFaxNumber;
	std::string homeTel;
	std::string officeTel;
	std::string mobileTel;
	std::string autoTel;
	std::string secondHomeTel;
	std::string secondOfficeTel;
	std::string secondMobileTel;
	std::string homeAddress;
	std::string officeAddress;
	std::string otherAddress;
};

class PersonData
{
public:
	PersonData():sex(notset),old(0){}
	std::string Uri() const { return uri; }
	void Uri(std::string val) { uri = val; }
	std::string Name() const { return name; }
	void Name(std::string val) { name = val; }
	PersonData::ESexType Sex() const { return sex; }
	void Sex(PersonData::ESexType val) { sex = val; }
	unsigned int Old() const { return old; }
	void Old(unsigned int val) { old = val; }
	std::string Birthday() const { return birthday; }
	void Birthday(std::string val) { birthday = val; }
	std::string Interest() const { return interest; }
	void Interest(std::string val) { interest = val; }
	std::string Occupation() const { return occupation; }
	void Occupation(std::string val) { occupation = val; }
	std::string Country() const { return country; }
	void Country(std::string val) { country = val; }
	std::string Zone() const { return zone; }
	void Zone(std::string val) { zone = val; }
	std::string City() const { return city; }
	void City(std::string val) { city = val; }
protected:
	std::string uri;
	std::string city;
	std::string zone;
	std::string country;
	std::string occupation;
	std::string interest;
	std::string birthday;
	ESexType sex;
	unsigned int old;
	std::string name;
};

class UserPreference
{
public:
	UserPreference(){}
	std::string AnswerMode() const { return answerMode; }
	void AnswerMode(std::string val) { answerMode = val; }
	std::string MsgDeliverReport() const { return msgDeliverReport; }
	void MsgDeliverReport(std::string val) { msgDeliverReport = val; }
	std::string OnlineNotify() const { return onlineNotify; }
	void OnlineNotify(std::string val) { onlineNotify = val; }
	std::string NotifyMode() const { return notifyMode; }
	void NotifyMode(std::string val) { notifyMode = val; }
protected:
	std::string answerMode;
	std::string msgDeliverReport;
	std::string onlineNotify;
	std::string notifyMode;
};

class PersonInfo
{
public:
	PersonInfo():sex(notset),old(0){}
	std::string Name() const { return name; }
	void Name(std::string val) { name = val; }
	ESexType Sex() const { return sex; }
	void Sex(ESexType val) { sex = val; }
	unsigned int Old() const { return old; }
	void Old(unsigned int val) { old = val; }
	std::string Birthday() const { return birthday; }
	void Birthday(std::string val) { birthday = val; }
	std::string Interest() const { return interest; }
	void Interest(std::string val) { interest = val; }
	std::string Occupation() const { return occupation; }
	void Occupation(std::string val) { occupation = val; }
protected:
	std::string name;
	ESexType sex;
	unsigned int old;
	std::string birthday;
	std::string interest;
	std::string occupation;
};

class BuddyEntry
{
public:
	BuddyEntry():contactInfoAvailable(false),personInfoAvailable(false){}
	std::string Uri() const { return uri; }
	void Uri(std::string val) { uri = val; }
	std::string DisplayName() const { return displayName; }
	void DisplayName(std::string val) { displayName = val; }
	ContactInfo BuddyContactInfo()  const { return buddyContactInfo; }
	void BuddyContactInfo(ContactInfo& val) 
	{ 
		buddyContactInfo = val; 
		contactInfoAvailable = true;
	}
	PersonInfo BuddyPersonInfo() const { return buddyPersonInfo; }
	void BuddyPersonInfo(PersonInfo& val) 
	{ 
		buddyPersonInfo = val; 
		personInfoAvailable = true;
	}
	bool ContactInfoAvailable() const { return contactInfoAvailable; }
	void ContactInfoAvailable(bool val) { contactInfoAvailable = val; }
	bool PersonInfoAvailable() const { return personInfoAvailable; }
	void PersonInfoAvailable(bool val) { personInfoAvailable = val; }
protected:
	ContactInfo buddyContactInfo;
	PersonInfo buddyPersonInfo;
	bool contactInfoAvailable;
	bool personInfoAvailable;
	std::string uri;
	std::string displayName;
};

class GroupEntry
{
public:
	GroupEntry(){}
	string_vector Path() const { return path; }
	void Path(string_vector val) { path = val; }
	std::string DisplayName() const { return displayName; }
	void DisplayName(std::string val) { displayName = val; }
protected:
	string_vector path;
	std::string displayName;
};

class ServiceEntry
{
public:
	ServiceEntry(){}
	std::string Uri() const { return uri; }
	void Uri(std::string val) { uri = val; }
	std::string ResourceListUri() const { return resourceListUri; }
	void ResourceListUri(std::string val) { resourceListUri = val; }
	GroupEntry Group() const { return group; }
	void Group(GroupEntry val) { group = val; }
	string_vector Packages() const { return packages; }
	void Packages(string_vector val) { packages = val; }
protected:
	std::string uri;
	std::string resourceListUri;
	GroupEntry group;
	string_vector packages;
};
